<?php include "../share/head.html" ?>
<script>
function SQ() {
	var replace = document.getElementById("select");
	var parent = document.getElementById("div1");
	var para = document.createElement("p");
	para.setAttribute("id","select");
	parent.replaceChild(para, replace);

	var where = document.getElementById("select");
	var text = document.createTextNode("安全问题：");
	where.appendChild(text);
	var inp = document.createElement("input");
	inp.setAttribute("type","input");
	inp.setAttribute("required","");
	inp.setAttribute("class","form-control");
	inp.setAttribute("name","squestion");
	var sel = document.createElement("select");
	sel.setAttribute("title","请选择安全问题");
	sel.setAttribute("id","sele");
	sel.setAttribute("name","sele");
	sel.setAttribute("class","form-control");
	var br = document.createElement("br");
	where.appendChild(br);
	where.appendChild(sel);
	where.appendChild(inp);
	//已生成选择框/输入框
	var main = document.getElementById("sele");
	var SQ = ["你母亲的名字是什么", "你父亲的名字是什么", "你是什么东西"];
	for (i = 0; i < 3; i++) { 
		var inp = document.createElement("option");
		inp.setAttribute("id",i);
		main.appendChild(inp);
		var where = document.getElementById(i);
		var Tnode =  document.createTextNode(SQ[i]);
		where.appendChild(Tnode);
	}
}
function AM(){
	var replace = document.getElementById("select");
	var parent = document.getElementById("div1");
	var para = document.createElement("p");
	para.setAttribute("id","select");
	parent.replaceChild(para, replace);

	var where = document.getElementById("select");
	var text = document.createTextNode("管理员验证码：");
	where.appendChild(text);
	var inp = document.createElement("input");
	inp.setAttribute("type","input");
	inp.setAttribute("required","");
	inp.setAttribute("name","code");
	inp.setAttribute("class","form-control");
	where.appendChild(inp);
	
}
</script>
<body>
<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<?php include "../share/nav-g.php" ?>
			<div class="row clearfix">
				<div class="col-md-8 column"><br/><br/><br/><br/>
					<h2>
						注册
					</h2>
					<form class="form-horizontal" role="form" action="../actions/signup.php" method="post">
						<div class="form-group"><br/>
							 <label for="inputEmail3" class="col-sm-2 control-label">真实姓名</label>
							<div class="col-sm-10">
								<input required type="input" class="form-control" name="name" />
							</div>
						</div>
						<div class="form-group">
							 <label for="inputPassword3" class="col-sm-2 control-label">学号</label>
							<div class="col-sm-10">
								<input required type="input" class="form-control" name="stid" />
							</div>
						</div>
						<div class="form-group">
							 <label for="inputPassword3" class="col-sm-2 control-label">密码</label>
							<div class="col-sm-10">
								<input required type="password" class="form-control" name="pw" />
							</div>
						</div>
						<div class="form-group">
							 <label for="inputPassword3" class="col-sm-2 control-label">身份</label>
							<div class="col-sm-10">
								<lable><input type="radio"  name="who" onclick="SQ()" value="0" required/>学生
								<input type="radio" name="who" onclick="AM()" value="1" required/>管理员</lable>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10" id="div1">
							<p id="select"></p>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
								 <button type="submit" class="btn btn-default">注册</button>
							</div>
						</div>
					</form>
				</div>
				<div class="col-md-4 column"><br/><br/><br/><br/><br/>
					<div class="alert alert-success alert-dismissable">
				 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
				<h4>
					提示!
				</h4> <strong>致学生：<br/></strong>学生注册后需等候管理员核对身份，核对身份后才能使用本系统全部功能，如“教室空闲查看”、“教室预约”。<br/>身份核对需时 1-3 天。<br/></br><strong>致管理员：<br/></strong>请通过右下方“联系我们”获取“管理员验证码”。
			</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?php include "../share/foot.html" ?>